<include file="Public:header"/>
<body class="J_scroll_fixed">
<div class="wrap J_check_wrap">
    <include file="Public:nav"/>
  <style>
        .yf-upload__mod {
        	margin: 0px 10px;
        }
        
        .yf-upload__btn {
        	
        }
        
        .yf-auto__list {
        	width: 100%;  
        	padding: 10px 0px 5px;
        	border-bottom: 1px solid #ddd;
        }
        
        .yf-auto__list:last-child {
        	border-bottom: none;
        }
        
        .yf-auto__one {
        	width: 20%;
        	display: inline-block;
        	border-right: 1px solid #ddd;
        }
        
        .yf-auto__three {
        	width: 30%;
        	display: inline-block;
        	border-right: 1px solid #ddd;
        }
        
        .yf-auto__three > input {
        	width: 90%;
        }
        
        .yf-auto__two {
        	width: 45%;
        	display: inline-block;
        }
        
        .yf-auto__two > input {
        	margin-left: 10px;
        }
        
        .yf-upload__settime {
        	display: inline-block;
        	margin-left: 20px;
        }
        
        .yf-upload__settime > input {
        	width: 20px;
        }
        
        .yf-config__date {
        	margin: 10px 0px;
        }
  </style>
  <form method="post" action="{:U('Automatic/upload', array('type' => $type, 'id' => $id))}" enctype="multipart/form-data">
    <a href="/muban.zip" class="yf-upload__mod">下载模板</a>
    <input value=""  type="file" name="file" style="width: 150px;">
    <button class="yf-upload__btn" type="submit">导入</button>
  </form>
  <form method="post" class="J_ajaxForm" action="{:U("Automatic/addmsg")}" >
    <div class="yf-config__date">
        开始时间
        <select name="year">
            {$year}
        </select>
        <select name="month">
            {$month}
        </select>
        <select name="day">
            {$day}
        </select>
        <select name="hour">
            {$hour}
        </select>
        <select name="minute">
            {$minute}
        </select>
        <div class="yf-upload__settime">
            每<input name="time" type="text" value="10">分钟内自动执行
        </div>
    </div>
    <div class="J_tabs_contents">
      <div>
        <div class="table_full">
          <table width="100%" class="table_form ">
                <tr>
                  <th width="400">{$title}</th>
                  <td style="background-color:#f3f3f3">
                   <foreach name="user" item="ur">
                        <div class="yf-auto__list">
                            <div class="yf-auto__one">{$ur.nickname}<input type="hidden" name="userid[]" value="{$ur.userid}"></div>
                            <div class="yf-auto__three"><input type="text" name="message[]" class="yf-comment_{$ur.userid}" placeholder="请输入留言内容"></div>
                            <div class="yf-auto__two">
                            <if condition="$temp_status.dig eq 1">
                                <input type="checkbox" name="dig_{$ur.userid}" value="1" checked>点赞
                            </if> 
                            <if condition="$temp_status.fav eq 1">
                                <input type="checkbox" name="fav_{$ur.userid}" value="1" checked>收藏
                            </if>
                            <if condition="$temp_status.fans eq 1">
                                <input type="checkbox" name="fans_{$ur.userid}" value="1" checked>关注
                            </if>
                            <if condition="$temp_status.comment eq 1">
                                <input type="checkbox" name="comment_{$ur.userid}" class="yf-comment" data-class="yf-comment_{$ur.userid}" value="1" checked>留言
                            </if>
                            </div>
                        </div> 
                   </foreach>
                  </td>
              </tr>
          </table>
        </div>
      </div>

    </div>
    <div class="btn_wrap">
      <div class="btn_wrap_pd">
      <input type="hidden" name="id" value="{$id}">
      <input type="hidden" name="type" value="{$type}">
        <button class="btn btn_submit mr10 J_ajax_submit_btn" type="submit">提交</button>
      </div>
    </div>
  </form>
</div>
<script type="text/javascript" src="__JS__/common.js"></script>
<script type="text/javascript" src="__JS__/content_addtop.js"></script>
<script>
     $(function(){
 	    $('.yf-comment').click(function(){
	    	  var check_type = $(this).attr('checked');
	    	  var classname = $(this).attr('data-class');
	    	  if(check_type == 'checked')
	    	  {
		    	  $('.'+classname).removeAttr("readonly").css('background-color', '#fff').attr("placeholder", "请输入留言的内容");
	    	  }
	    	  else
	    	  {
		    	  $('.'+classname).attr("readonly", "readonly").css('background-color','#ddd').attr("placeholder", "").val("");
	    	  }
 	    });
     });
</script>
</body>
</html>